package d0325;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class TestArrayList {
    public static void main(String[] args) {
       /* Collection<Integer>myList=new ArrayList<Integer>();
        myList.add(1);
        myList.add(2);
        myList.add(3);
        System.out.println(myList.isEmpty());
        System.out.println(myList.contains(2));
        myList.remove(3);
        System.out.println("元素个数："+myList.size());*/


        List<Integer> myList = new ArrayList<Integer> ();
        myList.add ( 0 ,11);
        myList.add ( 1 ,12);
        myList.add ( 2 ,13);
        myList.add ( 1 ,23);
        myList.add ( 44 );
//        System.out.println (myList.isEmpty () );
//        System.out.println (myList.contains ( 2 ) );
        myList.remove ( 2 );
        System.out.println ("元素的个数"+myList.size () );
        System.out.println (myList.get ( 2 ) );

        for (Integer i:
                myList) {
            System.out.print (i+"\t" );
        }


    }
}
